package com.superman.supermarket.client.activity;

import java.util.HashMap;
import java.util.Map;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.Window;
import com.google.inject.Inject;
import com.superman.mvpframe.client.ajax.PostManAsyncCallBack;
import com.superman.mvpframe.client.mvp.IPageView;
import com.superman.mvpframe.client.mvp.IPageViewPresenter;
import com.superman.mvpframe.client.utils.XJsonUtil;
import com.superman.supermarket.client.mvp.ShopAbstractActivity;
import com.superman.supermarket.client.view.logistics.OrderLogisticsView;

/**
 * 退款物流
 * 
 * @author superman
 * @version 2018年8月21日下午11:20:35
 */
public class RefundLogisticsActivity extends ShopAbstractActivity {

	@Inject
	OrderLogisticsView orderLogisticsView;
	private String refundId;

	private void getRefundLogistics() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("REFUND_ID", refundId);
		postman.post("refund/logistics", map, new PostManAsyncCallBack() {

			@Override
			public void onBusinessError(String statusCode) {

			}

			@Override
			public void onBusinessOK(String response) {
				orderLogisticsView.setOrderLogisticsList(XJsonUtil.getBody(response));
			}
		});
	}

	@Override
	public IPageView getView() {
		return orderLogisticsView;
	}

	@Override
	public IPageViewPresenter getViewPresenter() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void onActivity(EventBus eventBus) {
		// TODO Auto-generated method stub

	}

	@Override
	public void popToRefresh() {
		// TODO Auto-generated method stub

	}

	@Override
	public void popToRefresh(Object contextData) {
		// TODO Auto-generated method stub

	}

	@Override
	public void pushToRefresh() {
		refundId = Window.Location.getParameter("refundid");

		getRefundLogistics();
	}

}
